<?php

define('MIN_RATING', 0);

class Config {

    public static function getUploadDir() {
        return '/upload/';
    }

    public static function getImageDir() {
        return YiiBase::getPathOfAlias('webroot') . '/images';
    }

    public static function getImageUrl() {
        return Yii::app()->getBaseUrl() . '/images';
    }

    public static function getEmailDir() {
        return Yii::app()->getBasePath() . '/views/email/';
    }

    public static function dayOfWeek() {
        return array(
            "Sunday" => 'Sunday',
            "Monday" => "Monday",
            "Tuesday" => "Tuesday",
            "Wednesday" => "Wednesday",
            "Thursday" => "Thursday",
            "Friday" => "Friday",
            "Saturday" => "Saturday",
        );
    }

    public static function getTimeArrForEvents() {//Note: do not change the keys
        $arr = array();
        for ($i = 6; $i <= 11; $i++) {
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':00 AM'))] = $i . ':00 AM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':15 AM'))] = $i . ':15 AM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':30 AM'))] = $i . ':30 AM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':45 AM'))] = $i . ':45 AM';
        }

        $arr[(int) (strtotime('01/01/1970 12:00 PM'))] = '12:00 PM';
        $arr[(int) (strtotime('01/01/1970 12:15 PM'))] = '12:15 PM';
        $arr[(int) (strtotime('01/01/1970 12:30 PM'))] = '12:30 PM';
        $arr[(int) (strtotime('01/01/1970 12:45 PM'))] = '12:45 PM';

        for ($i = 1; $i <= 11; $i++) {
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':00 PM'))] = $i . ':00 PM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':15 PM'))] = $i . ':15 PM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':30 PM'))] = $i . ':30 PM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':45 PM'))] = $i . ':45 PM';
        }
        $arr[(int) (strtotime('01/01/1970 12:00 AM'))] = '12:00 AM';
        $arr[(int) (strtotime('01/01/1970 12:15 AM'))] = '12:15 AM';
        $arr[(int) (strtotime('01/01/1970 12:30 AM'))] = '12:30 AM';
        $arr[(int) (strtotime('01/01/1970 12:45 AM'))] = '12:45 AM';
        for ($i = 1; $i <= 5; $i++) {
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':00 AM'))] = $i . ':00 AM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':15 AM'))] = $i . ':15 AM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':30 AM'))] = $i . ':30 AM';
            $arr[(int) (strtotime('01/01/1970 ' . $i . ':45 AM'))] = $i . ':45 AM';
        }
        return $arr;
    }

    public static function getTimeArrV2() {//Note: do not change the keys
        $arr = array();
        for ($i = 6; $i <= 11; $i++) {
            $arr[$i . ':00 AM'] = $i . ':00 AM';
            $arr[$i . ':30 AM'] = $i . ':30 AM';
        }

        $arr['12:00 PM'] = '12:00 PM';
        $arr['12:30 PM'] = '12:30 PM';
        for ($i = 1; $i <= 11; $i++) {
            $arr[$i . ':00 PM'] = $i . ':00 PM';
            $arr[$i . ':30 PM'] = $i . ':30 PM';
        }
        $arr['12:00 AM'] = '12:00 AM';
        $arr['12:30 AM'] = '12:30 AM';
        for ($i = 1; $i <= 5; $i++) {
            $arr[$i . ':00 AM'] = $i . ':00 AM';
            $arr[$i . ':30 AM'] = $i . ':30 AM';
        }
        return $arr;
    }

    public static function getWeekArr($key = NULL) {
        $Arr = array(0 => 'Monday', 1 => 'Tuesday', 2 => 'Wednesday', 3 => 'Thursday', 4 => 'Friday', 5 => 'Saturday', 6 => 'Sunday');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }

    public static function getMonthlyArr($key = NULL) {
        $arr = array();
        for ($i = 1; $i <= 31; $i++) {
            $arr[$i] = $i;
        }

        if (!empty($key)) {
            return $arr[$key];
        } else {
            return $arr;
        }
    }

    public static function getYesNo($key = NULL) {
        $Arr = array('None' => 'None', 'No' => 'No', 'Yes' => 'Yes');

        if (!empty($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }

    public static function confirmation($key = NULL) {
        $Arr = array('None' => 'None', 'Ok' => 'Ok', 'Not OK' => 'Not OK');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }

    public static function avResult($key = NULL) {
        $Arr = array('None' => 'None', 'Negative' => 'Negative', 'Positive' => 'Positive', 'Poc' => 'Poc');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }
 public static function resident($key = NULL) {
        $Arr = array('None' => 'None', 'Posh' => 'Posh', 'standard' => 'standard', 'middle class' => 'middle class'
            , 'J and J' => 'J and J', 'V an PO' => 'V an PO', 'Slum' => 'Slum');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }
     public static function organization($key = NULL) {
        $Arr = array('None' => 'None', 'MNC' => 'MNC', 'Pvt Ltd' => 'Pvt Ltd', 'Govt' => 'Govt', 'Psu public ltd' => 'Psu public ltd'
            , 'Software BPO' => 'Software BPO', 'Small and Midum Bussiness' => 'Small and Midum Bussiness');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }
    public static function occupation($key = NULL) {
        $Arr = array('None' => 'None', 'seniour Management' => 'seniour Management', 'Professionals' => 'Professionals', 'Bussiness Large' => 'Bussiness Large'
            ,'Middle Mgmt' => 'Middle Mgmt', 'Bussiness Small and Mid' => 'Bussiness Small and Mid', 'Junior Mgmt' => 'Junior Mgmt', 'Student Retired Housewife' => 'Student Retired Housewife'
            ,'Clerical' => 'Clerical','Labour' => 'Labour');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }
    public static function company($key = NULL) {
        $Arr = array('None' => 'None', 'Cat a Professionals' => 'Cat a Professionals', 'Cat B Small Bussiness Owners' => 'Cat B Small Bussiness Owners',
            'Cat C' => 'Cat C', 'Cat D' => 'Cat D');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }
    public static function vehical($key = NULL) {
        $Arr = array('None' => 'None', 'Luxury car' => 'Luxury car', 'Large Car' => 'Large Car', 'Small Car' => 'Small Car', '2 wheeler' => '2 wheeler'
            , 'Other' => 'Other');

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }
    public static function userRole($key = NULL) {
        $Arr = array(1 => 'Web User', 2 => 'App User', );

        if (!is_null($key)) {
            return $Arr[$key];
        } else {
            return $Arr;
        }
    }
}

?>